# Contributor: Leo <thinkabit.ukim@gmail.com>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=taglib
pkgver=1.12
pkgrel=1
pkgdesc="Library for reading and editing metadata of several popular audio formats"
url="http://taglib.github.io/"
arch="all"
options="!check"  # No test suite.
license="LGPL-2.1-only OR MPL-1.1"
makedepends="zlib-dev cmake samurai"
subpackages="$pkgname-dev"
source="https://taglib.github.io/releases/taglib-$pkgver.tar.gz
	"

# secfixes:
#   1.11.1-r2:
#     - CVE-2017-12678
#     - CVE-2018-11439

build() {
	cmake -B build -G Ninja \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_BUILD_TYPE=MinSizeRel \
		-DWITH_ASF=ON \
		-DWITH_MP4=ON \
		-DBUILD_SHARED_LIBS=ON
	cmake --build build
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
7e369faa5e3c6c6401052b7a19e35b0cf8c1e5ed9597053ac731a7718791d5d4803d1b18a93e903ec8c3fc6cb92e34d9616daa2ae4d326965d4c4d5624dcdaba  taglib-1.12.tar.gz
"
